package com.acyouzi.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * 17/9/7 09:58
 *
 * @author sunxu
 */
public class Test {
  public static void main(String[] args) {
    ExecutorService pool = Executors.newCachedThreadPool();
    Runnable runnable = new Runnable() {
      @Override
      public void run() {
        System.out.println(Thread.currentThread().getName());
        try {
          Thread.sleep(Integer.MAX_VALUE);
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
      }
    };
    pool.submit(runnable);
    pool.submit(runnable);
    pool.submit(runnable);
  }
}
